home *** CD-ROM | disk | FTP | other *** search
/ CD Fun House 1 / CD Fun House (Wayzata Technology).iso / •Games Parlour• / HyperQuackey 1.1 •••• / HyperQuackey 1.1 ееее / background_2543.txt < prev    next >
Text File  |  1990-10-02  |  26KB  |  1,064 lines

  1. -- background: 2543 from stack: in.1 –µ–µ–µ–µ
  2. -- bmap block id: 4875
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: Playing Grounds
  6. ----- HyperTalk script -----
  7. on idle
  8.   global secsOffset, newWord, gameState, playingTime
  9.   --put gameState
  10.   if gameState = "clockRunning" then
  11.     put 0 into m
  12.     if the visible of field "Screen Mask" is true then
  13.       exit idle
  14.     end if
  15.     put playingTime-(the secs-secsOffset) into s
  16.     put s div 60 into m
  17.     put s mod 60 into s
  18.     if s < 10 then put "0" before s
  19.     if playingTime-(the secs-secsOffset) < 0 then
  20.       setGameState "clockRanOut"
  21.     else
  22.       put m & ":" & s into field Timer
  23.       put newWord into field "New Word"
  24.     end if
  25.   else if gameState = "clockRanOut" then
  26.     play "harpsichord" tempo 1000 "c5 d e f g a b c6"
  27.     setGameState "readyToScore"
  28.   end if
  29.   --put gameState
  30. end idle
  31.  
  32. on handleCubeClick
  33.   global newWord, gameState
  34.   if gameState = "clockRunning" then
  35.     put param(1) into buttonName
  36.     if the optionKey is down then
  37.       repeat while the mouse is down
  38.         set the location of bkgnd button buttonName to the mouseloc
  39.       end repeat
  40.     else
  41.       if the shiftKey is down then
  42.         set the hilite of bkgnd button buttonName to false
  43.         put length(newWord) into l
  44.         if l = 1 then put 0 into m else put 1 into m
  45.         put char m to l-1 of newWord into newWord
  46.       else
  47.         play "Harpsichord" tempo 1000 "e6"
  48.         if the hilite of bkgnd button buttonName is false then
  49.           put char 15 of the name of bkgnd button buttonName after newWord
  50.           set the hilite of bkgnd button buttonName to true
  51.         else errorSound
  52.       end if
  53.     end if
  54.   end if
  55. end handleCubeClick
  56.  
  57. on gameOver
  58.   global newWord, gameState
  59.   answer "Congratulations, " & field Username & ", you win!" with  "Done" or "Play again"
  60.   put it into theAnswer
  61.   setGameState "gameOver"
  62.   if theAnswer is "Done" then
  63.     resetGame
  64.     go card "Welcome"
  65.   else
  66.     newGame
  67.   end if
  68. end gameOver
  69.  
  70. on newGame
  71.   global gameState
  72.   set cursor to 4
  73.   set lockscreen to true
  74.   go card "Player 1"
  75.   put 0 into field Score
  76.   go next card
  77.   put 2 into i
  78.   repeat
  79.     if (the name of this card) = "card " & quote & "HQ Preferences" & quote
  80.     then
  81.     exit repeat
  82.   end if
  83.   put 0 into field Score
  84.   put empty into field "New Word"
  85.   add 1 to i
  86.   go next card
  87. end repeat
  88. go card "Player 1"
  89. hide bkgnd button 11
  90. hide bkgnd button 12
  91. hide bkgnd button 13
  92. show field "3 Letter Words"
  93. setGameState "readyToPlay"
  94. end newGame
  95.  
  96. on returnKey
  97.   global gameState
  98.   if the message box is empty or the visible of the message box is false then
  99.     if gameState = "readyToScore" then
  100.       set the hilite of bkgnd button "Score" to true
  101.       set the hilite of bkgnd button "Score" to false
  102.       send mouseUp to bkgnd button "Score"
  103.       exit returnKey
  104.     end if
  105.     if gameState = "readyToPlay" then
  106.       set the hilite of bkgnd button "New Roll" to true
  107.       set the hilite of bkgnd button "New Roll" to false
  108.       send mouseUp to bkgnd button "New Roll"
  109.       exit returnKey
  110.     end if
  111.     if gameState = "justOpened" or gameState = "gameOver" then
  112.       set the hilite of bkgnd button "New Game" to true
  113.       set the hilite of bkgnd button "New Game" to false
  114.       send mouseUp to bkgnd button "New Game"
  115.       exit returnKey
  116.     end if
  117.   else do the message box
  118. end returnKey
  119.  
  120. on enterKey
  121.   returnKey
  122. end enterKey
  123.  
  124. on arrowKey
  125.   errorSound
  126. end arrowKey
  127.  
  128. on handleRoll
  129.   put param(1) into buttonName
  130.   put param(2) into letters
  131.   set the name of bkgnd button buttonName to any char of letters
  132.   set the hilite of bkgnd button buttonName to false
  133. end handleRoll
  134.  
  135. on setGameState newState
  136.   global gameState
  137.   put newState into gameState
  138.   if gameState = "gameOver" or gameState = "justOpened" then
  139.     set the name of bkgnd button id 50 to "Press Return to start a new game"
  140.     show bkgnd button id 50
  141.   else if gameState = "readyToPlay" then
  142.     set the name of bkgnd button id 50 to "Press Return to roll the dice"
  143.     show bkgnd button id 50
  144.   else if gameState = "readyToScore" then
  145.     set the name of bkgnd button id 50 to "Press Return to score the round"
  146.     show bkgnd button id 50
  147.   else if gameState = "clockRunning" then
  148.     hide bkgnd button id 50
  149.   end if
  150. end setGameState
  151.  
  152.  
  153.  
  154.  
  155. -- part 1 (button)
  156. -- low flags: 00
  157. -- high flags: 8004
  158. -- rect: left=84 top=219 right=241 bottom=108
  159. -- title width / last selected line: 0
  160. -- icon id / first selected line: 0 / 0
  161. -- text alignment: 1
  162. -- font id: 0
  163. -- text size: 12
  164. -- style flags: 0
  165. -- line height: 16
  166. -- part name: J
  167. ----- HyperTalk script -----
  168. on mouseDown
  169.   handleCubeClick (the number of me)
  170. end mouseDown
  171.  
  172. on Roll
  173.   handleRoll (the number of me), "JXEZVQ"
  174. end Roll
  175.  
  176.  
  177. -- part 2 (button)
  178. -- low flags: 00
  179. -- high flags: 8004
  180. -- rect: left=110 top=216 right=238 bottom=133
  181. -- title width / last selected line: 0
  182. -- icon id / first selected line: 0 / 0
  183. -- text alignment: 1
  184. -- font id: 0
  185. -- text size: 12
  186. -- style flags: 0
  187. -- line height: 16
  188. -- part name: B
  189. ----- HyperTalk script -----
  190. on mouseDown
  191.   handleCubeClick (the number of me)
  192. end mouseDown
  193.  
  194. on Roll
  195.   handleRoll (the number of me), "RKHTBI"
  196. end Roll
  197.  
  198.  
  199. -- part 4 (button)
  200. -- low flags: 00
  201. -- high flags: 8004
  202. -- rect: left=149 top=219 right=241 bottom=172
  203. -- title width / last selected line: 0
  204. -- icon id / first selected line: 0 / 0
  205. -- text alignment: 1
  206. -- font id: 0
  207. -- text size: 12
  208. -- style flags: 0
  209. -- line height: 16
  210. -- part name: U
  211. ----- HyperTalk script -----
  212. on mouseDown
  213.   handleCubeClick (the number of me)
  214. end mouseDown
  215.  
  216. on Roll
  217.   handleRoll (the number of me), "TIFPNU"
  218. end Roll
  219.  
  220.  
  221. -- part 5 (button)
  222. -- low flags: 00
  223. -- high flags: 8004
  224. -- rect: left=175 top=213 right=235 bottom=199
  225. -- title width / last selected line: 0
  226. -- icon id / first selected line: 0 / 0
  227. -- text alignment: 1
  228. -- font id: 0
  229. -- text size: 12
  230. -- style flags: 0
  231. -- line height: 16
  232. -- part name: O
  233. ----- HyperTalk script -----
  234. on mouseDown
  235.   handleCubeClick (the number of me)
  236. end mouseDown
  237.  
  238. on Roll
  239.   handleRoll (the number of me), "WLBOOY"
  240. end Roll
  241.  
  242.  
  243. -- part 8 (button)
  244. -- low flags: 00
  245. -- high flags: 8004
  246. -- rect: left=85 top=243 right=265 bottom=108
  247. -- title width / last selected line: 0
  248. -- icon id / first selected line: 0 / 0
  249. -- text alignment: 1
  250. -- font id: 0
  251. -- text size: 12
  252. -- style flags: 0
  253. -- line height: 16
  254. -- part name: C
  255. ----- HyperTalk script -----
  256. on mouseDown
  257.   handleCubeClick (the number of me)
  258. end mouseDown
  259.  
  260. on Roll
  261.   handleRoll (the number of me), "COPMOW"
  262. end Roll
  263.  
  264.  
  265. -- part 9 (button)
  266. -- low flags: 00
  267. -- high flags: 8004
  268. -- rect: left=112 top=249 right=271 bottom=135
  269. -- title width / last selected line: 0
  270. -- icon id / first selected line: 0 / 0
  271. -- text alignment: 1
  272. -- font id: 0
  273. -- text size: 12
  274. -- style flags: 0
  275. -- line height: 16
  276. -- part name: N
  277. ----- HyperTalk script -----
  278. on mouseDown
  279.   handleCubeClick (the number of me)
  280. end mouseDown
  281.  
  282. on Roll
  283.   handleRoll (the number of me), "TODLNR"
  284. end Roll
  285.  
  286.  
  287. -- part 10 (button)
  288. -- low flags: 00
  289. -- high flags: 8004
  290. -- rect: left=140 top=245 right=267 bottom=163
  291. -- title width / last selected line: 0
  292. -- icon id / first selected line: 0 / 0
  293. -- text alignment: 1
  294. -- font id: 0
  295. -- text size: 12
  296. -- style flags: 0
  297. -- line height: 16
  298. -- part name: E
  299. ----- HyperTalk script -----
  300. on mouseDown
  301.   handleCubeClick (the number of me)
  302. end mouseDown
  303.  
  304. on Roll
  305.   handleRoll (the number of me), "AAAEEE"
  306. end Roll
  307.  
  308.  
  309. -- part 11 (button)
  310. -- low flags: 00
  311. -- high flags: 8004
  312. -- rect: left=179 top=241 right=263 bottom=202
  313. -- title width / last selected line: 0
  314. -- icon id / first selected line: 0 / 0
  315. -- text alignment: 1
  316. -- font id: 0
  317. -- text size: 12
  318. -- style flags: 0
  319. -- line height: 16
  320. -- part name: A
  321. ----- HyperTalk script -----
  322. on mouseDown
  323.   handleCubeClick (the number of me)
  324. end mouseDown
  325.  
  326. on Roll
  327.   handleRoll (the number of me), "AAAEEE"
  328. end Roll
  329.  
  330.  
  331. -- part 12 (button)
  332. -- low flags: 00
  333. -- high flags: 8004
  334. -- rect: left=81 top=276 right=298 bottom=104
  335. -- title width / last selected line: 0
  336. -- icon id / first selected line: 0 / 0
  337. -- text alignment: 1
  338. -- font id: 0
  339. -- text size: 12
  340. -- style flags: 0
  341. -- line height: 16
  342. -- part name: U
  343. ----- HyperTalk script -----
  344. on mouseDown
  345.   handleCubeClick (the number of me)
  346. end mouseDown
  347.  
  348. on Roll
  349.   handleRoll (the number of me), "SUIRGM"
  350. end Roll
  351.  
  352.  
  353. -- part 13 (button)
  354. -- low flags: 00
  355. -- high flags: 8004
  356. -- rect: left=116 top=277 right=299 bottom=139
  357. -- title width / last selected line: 0
  358. -- icon id / first selected line: 0 / 0
  359. -- text alignment: 1
  360. -- font id: 0
  361. -- text size: 12
  362. -- style flags: 0
  363. -- line height: 16
  364. -- part name: U
  365. ----- HyperTalk script -----
  366. on mouseDown
  367.   handleCubeClick (the number of me)
  368. end mouseDown
  369.  
  370. on Roll
  371.   handleRoll (the number of me), "HIFSUR"
  372. end Roll
  373.  
  374.  
  375. -- part 7 (button)
  376. -- low flags: 80
  377. -- high flags: 8004
  378. -- rect: left=145 top=277 right=300 bottom=170
  379. -- title width / last selected line: 0
  380. -- icon id / first selected line: 0 / 0
  381. -- text alignment: 1
  382. -- font id: 0
  383. -- text size: 12
  384. -- style flags: 0
  385. -- line height: 16
  386. -- part name: C
  387. ----- HyperTalk script -----
  388. on mouseDown
  389.   handleCubeClick (the number of me)
  390. end mouseDown
  391.  
  392. on Roll
  393.   handleRoll (the number of me), "GDCJMK"
  394. end Roll
  395.  
  396.  
  397. -- part 3 (button)
  398. -- low flags: 80
  399. -- high flags: 8004
  400. -- rect: left=171 top=272 right=295 bottom=196
  401. -- title width / last selected line: 0
  402. -- icon id / first selected line: 0 / 0
  403. -- text alignment: 1
  404. -- font id: 0
  405. -- text size: 12
  406. -- style flags: 0
  407. -- line height: 16
  408. -- part name: Q
  409. ----- HyperTalk script -----
  410. on mouseDown
  411.   handleCubeClick (the number of me)
  412. end mouseDown
  413.  
  414. on Roll
  415.   handleRoll (the number of me), "WVSSQY"
  416. end Roll
  417.  
  418.  
  419. -- part 6 (button)
  420. -- low flags: 80
  421. -- high flags: 8004
  422. -- rect: left=88 top=309 right=332 bottom=113
  423. -- title width / last selected line: 0
  424. -- icon id / first selected line: 0 / 0
  425. -- text alignment: 1
  426. -- font id: 0
  427. -- text size: 12
  428. -- style flags: 0
  429. -- line height: 16
  430. -- part name: B
  431. ----- HyperTalk script -----
  432. on mouseDown
  433.   handleCubeClick (the number of me)
  434. end mouseDown
  435.  
  436. on Roll
  437.   handleRoll (the number of me), "PFNHLB"
  438. end Roll
  439.  
  440.  
  441. -- part 14 (button)
  442. -- low flags: 00
  443. -- high flags: A003
  444. -- rect: left=341 top=243 right=263 bottom=396
  445. -- title width / last selected line: 0
  446. -- icon id / first selected line: 0 / 0
  447. -- text alignment: 1
  448. -- font id: 0
  449. -- text size: 12
  450. -- style flags: 0
  451. -- line height: 16
  452. -- part name: Score
  453. ----- HyperTalk script -----
  454. on mouseUp
  455.   global gameState, numPlayers, curPlayer, vulScore, winningScore
  456.   if gameState = "readyToScore" then
  457.     put field Score into savedScore
  458.     repeat with i = 3 to 10
  459.       do "send Score to field " & quote & i & " Letter Words" & quote
  460.     end repeat
  461.     if savedScore ‚â• vulScore then --if vulnerable, check score above 500
  462.       if field Score - savedScore < 500 then
  463.         put savedScore - 500 into field Score
  464.       end if
  465.     end if
  466.     put "-:--" into field Timer
  467.     if field Score ‚â• winningScore then
  468.       gameOver
  469.     else
  470.       set lockscreen to true
  471.       go next card
  472.       if (the name of this card) ‚↠"card " & quote & "HQ Preferences" & quote then
  473.         answer "Get ready for the next roll!" with "OK"
  474.         go previous card
  475.         set lockscreen to false
  476.         visual effect scroll left
  477.         go next card
  478.       else
  479.         answer "Get ready for the next roll!" with "OK"
  480.         go previous card
  481.         set lockscreen to false
  482.         visual effect scroll right
  483.         go card "Player 1"
  484.       end if
  485.       setGameState "readyToPlay"
  486.     end if
  487.   end if
  488.   --put gameState
  489. end mouseUp
  490.  
  491.  
  492. -- part 15 (button)
  493. -- low flags: 00
  494. -- high flags: 8004
  495. -- rect: left=342 top=199 right=220 bottom=501
  496. -- title width / last selected line: 0
  497. -- icon id / first selected line: 0 / 0
  498. -- text alignment: 1
  499. -- font id: 0
  500. -- text size: 12
  501. -- style flags: 0
  502. -- line height: 16
  503. -- part name: Clear word in progress
  504. ----- HyperTalk script -----
  505. on mouseUp
  506.   global newWord
  507.   put empty into newWord
  508.   put empty into field "New Word"
  509.   repeat with i = 1 to 13
  510.     set the hilite of bkgnd button i to false
  511.   end repeat
  512. end mouseUp
  513.  
  514.  
  515.  
  516. -- part 16 (button)
  517. -- low flags: 00
  518. -- high flags: A003
  519. -- rect: left=341 top=265 right=285 bottom=415
  520. -- title width / last selected line: 0
  521. -- icon id / first selected line: 0 / 0
  522. -- text alignment: 1
  523. -- font id: 0
  524. -- text size: 12
  525. -- style flags: 0
  526. -- line height: 16
  527. -- part name: New Roll
  528. ----- HyperTalk script -----
  529. on mouseUp
  530.   global secsOffset, gameState, newWord, vulScore
  531.   --put gameState
  532.   if gameState = "justOpened" then
  533.     send mouseUp to bkgnd button "New Game"
  534.   end if
  535.   if gameState = "readyToPlay" then
  536.     set cursor to 4
  537.     -- check for vulnerability
  538.     if field "Score" ‚â• vulScore then
  539.       show bkgnd button 11
  540.       show bkgnd button 12
  541.       show bkgnd button 13
  542.       hide field "3 Letter Words"
  543.     end if
  544.     -- clear out word lists
  545.     repeat with i = 3 to 10
  546.       do "put empty into field " & quote & i & " Letter Words" & quote
  547.     end repeat
  548.     play "harpsichord" tempo 70 "c4 c c c c5 c c c"
  549.     resetCubes
  550.     put empty into newWord
  551.     put empty into field "New Word"
  552.     put the secs into secsOffset
  553.     setGameState "clockRunning"
  554.   else
  555.     if gameState = "clockRanOut" or gameState = "readyToScore" then
  556.       answer "Please score this roll first." with "OK"
  557.     end if
  558.   end if
  559.   --put gameState
  560. end mouseUp
  561.  
  562. on resetCubes
  563.   put 0 into j
  564.   put 0 into k
  565.   repeat with i = 1 to 13
  566.     send Roll to bkgnd button i
  567.     put random(10) into r1
  568.     put random(10) into r2
  569.     set the location of bkgnd button i to 90+30*k+r1, 220+30*j+r2
  570.     if i mod 4 = 0 then
  571.       add 1 to j
  572.       put 0 into k
  573.     else
  574.       add 1 to k
  575.     end if
  576.   end repeat
  577. end resetCubes
  578.  
  579.  
  580.  
  581. -- part 17 (button)
  582. -- low flags: 00
  583. -- high flags: 8004
  584. -- rect: left=342 top=152 right=197 bottom=501
  585. -- title width / last selected line: 0
  586. -- icon id / first selected line: 0 / 0
  587. -- text alignment: 1
  588. -- font id: 0
  589. -- text size: 12
  590. -- style flags: 0
  591. -- line height: 16
  592. -- part name: Word
  593. ----- HyperTalk script -----
  594. on mouseUp
  595.   global newWord, gameState
  596.   put length(newWord) into wLen
  597.   if wLen ‚â• 3 and wLen ‚⧠10 and gameState = "clockRunning" then
  598.     -- set lockscreen to true
  599.     put quote & wLen & " Letter Words" & quote into fName
  600.     if wLen > 3 and char wLen of newWord = "S" then
  601.       put quote & wLen-1 & " Letter Words" & quote into singularFName
  602.       do "put field " & singularFName & "into temp1"
  603.       put (char 1 to (wLen-1) of newWord) into singularWord
  604.     else
  605.       put "!" into temp1
  606.       put "%" into singularWord
  607.     end if
  608.     do "put field " & fName & "into temp2"
  609.     if offset(newWord, temp2) = 0 and offset(singularWord, temp1) = 0 then
  610.       do "put newWord & return after field " & fName
  611.       wordSound
  612.       do "put the number of lines in field " & fName & " into temp"
  613.       if temp ‚â• 5 then
  614.         wordSound
  615.       end if
  616.     else errorSound
  617.   else errorSound
  618.   put empty into newWord
  619.   repeat with i = 1 to 13
  620.     set the hilite of bkgnd button i to false
  621.   end repeat
  622.   set the cursor to 0
  623. end mouseUp
  624.  
  625. on wordSound
  626.   play "harpsichord" tempo 1500 "c4 e5 g6"
  627. end wordSound
  628.  
  629.  
  630.  
  631. -- part 20 (field)
  632. -- low flags: 01
  633. -- high flags: 0002
  634. -- rect: left=341 top=291 right=316 bottom=415
  635. -- title width / last selected line: 0
  636. -- icon id / first selected line: 0 / 0
  637. -- text alignment: 0
  638. -- font id: 3
  639. -- text size: 18
  640. -- style flags: 0
  641. -- line height: 24
  642. -- part name: Score
  643.  
  644.  
  645. -- part 21 (field)
  646. -- low flags: 01
  647. -- high flags: 0002
  648. -- rect: left=5 top=152 right=171 bottom=170
  649. -- title width / last selected line: 0
  650. -- icon id / first selected line: 0 / 0
  651. -- text alignment: 0
  652. -- font id: 3
  653. -- text size: 12
  654. -- style flags: 256
  655. -- line height: 16
  656. -- part name: New Word
  657.  
  658.  
  659. -- part 22 (field)
  660. -- low flags: 00
  661. -- high flags: 4002
  662. -- rect: left=5 top=81 right=145 bottom=40
  663. -- title width / last selected line: 0
  664. -- icon id / first selected line: 0 / 0
  665. -- text alignment: 0
  666. -- font id: 4
  667. -- text size: 9
  668. -- style flags: 0
  669. -- line height: 12
  670. -- part name: 3 Letter Words
  671. ----- HyperTalk script -----
  672. on Score
  673.   put the number of lines of field (the number of me) into nLines
  674.   if nLines > 0 and field "Score" < 2000 then
  675.     put 50 into base
  676.     if nLines > 5 then put 5 into nLines
  677.     add 10*nLines to base
  678.     add base to field Score
  679.   end if
  680. end Score
  681.  
  682.  
  683. -- part 24 (field)
  684. -- low flags: 00
  685. -- high flags: 4002
  686. -- rect: left=43 top=81 right=146 bottom=80
  687. -- title width / last selected line: 0
  688. -- icon id / first selected line: 0 / 0
  689. -- text alignment: 0
  690. -- font id: 4
  691. -- text size: 9
  692. -- style flags: 0
  693. -- line height: 12
  694. -- part name: 4 Letter Words
  695. ----- HyperTalk script -----
  696. on Score
  697.   put the number of lines of field (the number of me) into nLines
  698.   if nLines > 0 then
  699.     if nLines > 5 then put 5 into nLines
  700.     put 100 into base
  701.     add 20*nLines to base
  702.     add base to field Score
  703.     if nLines = 5 and the number of lines of field "3 Letter Words" = 5 and field Score < 2000 then
  704.       add 300 to field Score
  705.     end if
  706.   end if
  707. end Score
  708.  
  709.  
  710.  
  711. -- part 25 (field)
  712. -- low flags: 00
  713. -- high flags: 4002
  714. -- rect: left=83 top=81 right=146 bottom=128
  715. -- title width / last selected line: 0
  716. -- icon id / first selected line: 0 / 0
  717. -- text alignment: 0
  718. -- font id: 4
  719. -- text size: 9
  720. -- style flags: 0
  721. -- line height: 12
  722. -- part name: 5 Letter Words
  723. ----- HyperTalk script -----
  724. on Score
  725.   put the number of lines of field (the number of me) into nLines
  726.   if nLines > 0 then
  727.     if nLines > 5 then put 5 into nLines
  728.     put 150 into base
  729.     add 50*nLines to base
  730.     add base to field Score
  731.     if nLines = 5 and the number of lines of field "4 Letter Words" = 5 then
  732.       add 500 to field Score
  733.     end if
  734.   end if
  735. end Score
  736.  
  737.  
  738. -- part 26 (field)
  739. -- low flags: 00
  740. -- high flags: 4002
  741. -- rect: left=131 top=81 right=146 bottom=183
  742. -- title width / last selected line: 0
  743. -- icon id / first selected line: 0 / 0
  744. -- text alignment: 0
  745. -- font id: 4
  746. -- text size: 9
  747. -- style flags: 0
  748. -- line height: 12
  749. -- part name: 6 Letter Words
  750. ----- HyperTalk script -----
  751. on Score
  752.   put the number of lines of field (the number of me) into nLines
  753.   if nLines > 0 then
  754.     if nLines > 5 then put 5 into nLines
  755.     put 200 into base
  756.     add 100*nLines to base
  757.     add base to field Score
  758.     if nLines = 5 and the number of lines of field "4 Letter Words" = 5 then
  759.       add 800 to field Score
  760.     end if
  761.   end if
  762. end Score
  763.  
  764.  
  765. -- part 27 (field)
  766. -- low flags: 00
  767. -- high flags: 4002
  768. -- rect: left=186 top=81 right=146 bottom=250
  769. -- title width / last selected line: 0
  770. -- icon id / first selected line: 0 / 0
  771. -- text alignment: 0
  772. -- font id: 4
  773. -- text size: 9
  774. -- style flags: 0
  775. -- line height: 12
  776. -- part name: 7 Letter Words
  777. ----- HyperTalk script -----
  778. on Score
  779.   put the number of lines of field (the number of me) into nLines
  780.   if nLines > 0 then
  781.     if nLines > 5 then put 5 into nLines
  782.     put 350 into base
  783.     add 150*nLines to base
  784.     add base to field Score
  785.     if nLines = 5 and the number of lines of field "4 Letter Words" = 5 then
  786.       add 1200 to field Score
  787.     end if
  788.   end if
  789. end Score
  790.  
  791.  
  792. -- part 28 (field)
  793. -- low flags: 00
  794. -- high flags: 4002
  795. -- rect: left=253 top=81 right=146 bottom=324
  796. -- title width / last selected line: 0
  797. -- icon id / first selected line: 0 / 0
  798. -- text alignment: 0
  799. -- font id: 4
  800. -- text size: 9
  801. -- style flags: 0
  802. -- line height: 12
  803. -- part name: 8 Letter Words
  804. ----- HyperTalk script -----
  805. on Score
  806.   put the number of lines of field (the number of me) into nLines
  807.   if nLines > 0 then
  808.     if nLines > 5 then put 5 into nLines
  809.     put 500 into base
  810.     add 250*nLines to base
  811.     add base to field Score
  812.     if nLines = 5 and the number of lines of field "4 Letter Words" = 5 then
  813.       add 1850 to field Score
  814.     end if
  815.   end if
  816. end Score
  817.  
  818.  
  819. -- part 29 (field)
  820. -- low flags: 00
  821. -- high flags: 4002
  822. -- rect: left=327 top=81 right=146 bottom=410
  823. -- title width / last selected line: 0
  824. -- icon id / first selected line: 0 / 0
  825. -- text alignment: 0
  826. -- font id: 4
  827. -- text size: 9
  828. -- style flags: 0
  829. -- line height: 12
  830. -- part name: 9 Letter Words
  831. ----- HyperTalk script -----
  832. on Score
  833.   put the number of lines of field (the number of me) into nLines
  834.   if nLines > 0 then
  835.     if nLines > 5 then put 5 into nLines
  836.     put 500 into base
  837.     add 500*nLines to base
  838.     add base to field Score
  839.   end if
  840. end Score
  841.  
  842.  
  843. -- part 30 (field)
  844. -- low flags: 00
  845. -- high flags: 4002
  846. -- rect: left=413 top=81 right=145 bottom=500
  847. -- title width / last selected line: 0
  848. -- icon id / first selected line: 0 / 0
  849. -- text alignment: 0
  850. -- font id: 4
  851. -- text size: 9
  852. -- style flags: 0
  853. -- line height: 12
  854. -- part name: 10 Letter Words
  855. ----- HyperTalk script -----
  856. on Score
  857.   put the number of lines of field (the number of me) into nLines
  858.   if nLines > 0 then
  859.     if nLines > 5 then put 5 into nLines
  860.     add 1500*nLines to field Score
  861.   end if
  862. end Score
  863.  
  864.  
  865. -- part 32 (button)
  866. -- low flags: 00
  867. -- high flags: A003
  868. -- rect: left=417 top=265 right=285 bottom=501
  869. -- title width / last selected line: 0
  870. -- icon id / first selected line: 0 / 0
  871. -- text alignment: 1
  872. -- font id: 0
  873. -- text size: 12
  874. -- style flags: 0
  875. -- line height: 16
  876. -- part name: New Game
  877. ----- HyperTalk script -----
  878. on mouseUp
  879.   global gameState, newWord
  880.   if the optionKey is down then
  881.     resetGame
  882.   else
  883.     if gameState ‚↠"justOpened" and gameState ‚↠"gameOver" then
  884.       --we're in the middle of a game
  885.       answer "End the current game?" with "Yes" or "Cancel"
  886.       if it = "Yes" then newGame --we've already inited cards
  887.       exit mouseUp
  888.     end if
  889.   end if
  890.   repeat with i = 1 to 13
  891.     set the hilite of bkgnd button i to false
  892.   end repeat
  893.   hide bkgnd button 11
  894.   hide bkgnd button 12
  895.   hide bkgnd button 13
  896.   show field "3 Letter Words"
  897.   repeat
  898.     ask "How many players?" with 1
  899.     if it is empty then
  900.       setGameState "justOpened"
  901.       exit mouseUp
  902.     end if
  903.     if it ‚â• "0" and it ‚⧠"9" then
  904.       exit repeat
  905.     else answer "Please enter a number." with "OK"
  906.   end repeat
  907.   if it > 1 then
  908.     repeat with i = 1 to it
  909.       ask "What is the name of player " & i & "?"
  910.       put it into playerName
  911.       if i > 1 then
  912.         set lockscreen to true
  913.         doMenu "New Card"
  914.         set the name of this card to "Player" & i
  915.       end if
  916.       put playerName into field Username
  917.     end repeat
  918.   else
  919.     ask "What is your name?"
  920.     put it into field Username
  921.   end if
  922.   setGameState "readyToPlay"
  923.   go card "Player 1"
  924.   put 0 into field Score
  925. end mouseUp
  926.  
  927.  
  928.  
  929. -- part 33 (field)
  930. -- low flags: 01
  931. -- high flags: 0002
  932. -- rect: left=426 top=291 right=316 bottom=488
  933. -- title width / last selected line: 0
  934. -- icon id / first selected line: 0 / 0
  935. -- text alignment: 0
  936. -- font id: 3
  937. -- text size: 18
  938. -- style flags: 0
  939. -- line height: 24
  940. -- part name: Timer
  941.  
  942.  
  943. -- part 34 (field)
  944. -- low flags: 01
  945. -- high flags: 0002
  946. -- rect: left=173 top=152 right=171 bottom=303
  947. -- title width / last selected line: 0
  948. -- icon id / first selected line: 0 / 0
  949. -- text alignment: 0
  950. -- font id: 3
  951. -- text size: 12
  952. -- style flags: 256
  953. -- line height: 16
  954. -- part name: Username
  955.  
  956.  
  957. -- part 47 (button)
  958. -- low flags: 00
  959. -- high flags: A003
  960. -- rect: left=398 top=243 right=263 bottom=501
  961. -- title width / last selected line: 0
  962. -- icon id / first selected line: 0 / 0
  963. -- text alignment: 1
  964. -- font id: 0
  965. -- text size: 12
  966. -- style flags: 0
  967. -- line height: 16
  968. -- part name: Preferences
  969. ----- HyperTalk script -----
  970. on mouseUp
  971.   global gameState
  972.   if gameState ‚↠"gameOver" and gameState ‚↠"justOpened" then
  973.     answer "End the current game?" with "Yes" or "Cancel"
  974.     if it is "Cancel" then exit mouseUp
  975.   end if
  976.   resetGame
  977.   visual effect zoom out
  978.   go card "HQ Preferences"
  979. end mouseUp
  980.  
  981.  
  982. -- part 40 (field)
  983. -- low flags: 81
  984. -- high flags: 0002
  985. -- rect: left=1 top=78 right=341 bottom=511
  986. -- title width / last selected line: 0
  987. -- icon id / first selected line: 0 / 0
  988. -- text alignment: 1
  989. -- font id: 3
  990. -- text size: 12
  991. -- style flags: 0
  992. -- line height: 16
  993. -- part name: Screen Mask
  994.  
  995.  
  996. -- part 43 (button)
  997. -- low flags: 00
  998. -- high flags: A004
  999. -- rect: left=342 top=222 right=241 bottom=501
  1000. -- title width / last selected line: 0
  1001. -- icon id / first selected line: 0 / 0
  1002. -- text alignment: 1
  1003. -- font id: 0
  1004. -- text size: 12
  1005. -- style flags: 0
  1006. -- line height: 16
  1007. -- part name: Pause
  1008. ----- HyperTalk script -----
  1009. on mouseUp
  1010.   global gameState, secsOffset, pauseOffset
  1011.   if gameState = "clockRunning" then
  1012.     if the name of bkgnd button (the number of me) contains "Pause" then
  1013.       show field "Screen Mask"
  1014.       set the name of bkgnd button (the number of me) to "Resume"
  1015.       put the secs into pauseOffset
  1016.     else
  1017.       hide field "Screen Mask"
  1018.       set the name of bkgnd button (the number of me) to "Pause"
  1019.       add (the secs - pauseOffset) to secsOffset
  1020.     end if
  1021.   end if
  1022. end mouseUp
  1023.  
  1024.  
  1025.  
  1026. -- part 48 (button)
  1027. -- low flags: 00
  1028. -- high flags: 0000
  1029. -- rect: left=470 top=39 right=68 bottom=502
  1030. -- title width / last selected line: 0
  1031. -- icon id / first selected line: 2478 / 2478
  1032. -- text alignment: 1
  1033. -- font id: 0
  1034. -- text size: 12
  1035. -- style flags: 0
  1036. -- line height: 16
  1037. -- part name: About
  1038. ----- HyperTalk script -----
  1039. on mouseUp
  1040.   global gameState
  1041.   if gameState ‚↠"gameOver" and gameState ‚↠"justOpened" then
  1042.     answer "End the current game?" with "Yes" or "Cancel"
  1043.     if it is "Cancel" then exit mouseUp
  1044.   end if
  1045.   resetGame
  1046.   go card "Welcome"
  1047. end mouseUp
  1048.  
  1049.  
  1050.  
  1051.  
  1052. -- part 50 (button)
  1053. -- low flags: 00
  1054. -- high flags: 8002
  1055. -- rect: left=5 top=188 right=206 bottom=302
  1056. -- title width / last selected line: 0
  1057. -- icon id / first selected line: 0 / 0
  1058. -- text alignment: 1
  1059. -- font id: 0
  1060. -- text size: 12
  1061. -- style flags: 0
  1062. -- line height: 16
  1063. -- part name: Press Return to start a new game
  1064.